import requests
from common.get_headers import get_headers
class ihrmzsgc():
    # 员工添加
    @classmethod
    def insert(cls,json_data):
        headers = get_headers()
        resp = requests.post(url="http://ihrm2-test.itheima.net/api/sys/user",
                             headers=headers,
                             json=json_data)
        return resp

    # 员工修改
    @classmethod
    def gai(cls,emp_id,json_data):
        headers = get_headers()
        resp = requests.put(url=f"http://ihrm2-test.itheima.net/api/sys/user/{emp_id}",
                            headers=headers,
                            json=json_data)
        return resp

